package com.wooophone.mpyeah.biz.impl;

import java.util.List;
import java.util.Map;

import org.apache.log4j.Logger;
import org.springframework.beans.factory.annotation.Autowired;

import com.wooophone.mpyeah.biz.OnLineStoreBiz;
import com.wooophone.mpyeah.biz.exception.CannotDeleteException;
import com.wooophone.mpyeah.dao.OnLineStoreDao;
import com.wooophone.mpyeah.entity.OnLineStore;

public class OnLineStoreBizImpl implements OnLineStoreBiz {
	Logger log = Logger.getLogger(OnLineStoreBiz.class);
	@Autowired
	OnLineStoreDao onLineStoreDao;

	@Override
	public OnLineStore save(OnLineStore obj) {
		return onLineStoreDao.save(obj);
	}

	@Override
	public int update(OnLineStore obj) {
		return onLineStoreDao.update(obj);
	}

	@Override
	public int delete(String id) throws CannotDeleteException {
		return onLineStoreDao.delete(id);
	}

	@Override
	public OnLineStore get(String id) {
		return onLineStoreDao.get(id);
	}

	@Override
	public List<OnLineStore> list() {
		return onLineStoreDao.list();
	}

	@Override
	public List<OnLineStore> list(int offset, int limit) {
		return onLineStoreDao.list(offset, limit);
	}

	@Override
	public int count() {
		return onLineStoreDao.count();
	}

	@Override
	public List<OnLineStore> find(Map<String, Object> parameter) {
		return onLineStoreDao.find(parameter);
	}

	@Override
	public List<OnLineStore> find(Map<String, Object> parameter, int offset,
			int limit) {
		return onLineStoreDao.find(parameter, offset, limit);
	}

	@Override
	public int count(Map<String, Object> parameter) {
		return onLineStoreDao.count(parameter);
	}

	@Override
	public int count(String keyword) {
		return onLineStoreDao.count(keyword);
	}

	@Override
	public List<OnLineStore> search(String keyword, int offset, int limit) {
		return onLineStoreDao.search(keyword, offset, limit);
	}

	public void setOnLineStoreDao(OnLineStoreDao onLineStoreDao) {
		this.onLineStoreDao = onLineStoreDao;
	}


	public int countByBrandId(String brandId) {
		return onLineStoreDao.countByBrandId(brandId);
	}

	@Override
	public List<OnLineStore> recommendOnLineStore(int offset, int status) {
		return onLineStoreDao.recommendOnLineStore(offset, status);
	}

	@Override
	public List<OnLineStore> recommendOnLineStore(int level, int offset,
			int limit) {
		return onLineStoreDao.recommendOnLineStore(level,offset, limit);
	}

	@Override
	public List<OnLineStore> recommendOnLineStoreLimitLevel(int limitLevel,
			int offset, int limit) {
		return onLineStoreDao.recommendOnLineStoreLimitLevel(limitLevel, offset, limit);
	}

}
